package com.nemlistapp;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public class Connection {
	
	private static Connection instance;
	
	private Connection()
	{
		
	}
	
	public static Connection getInstance()
	{
		if(instance == null)
		{
			instance = new Connection();
		}
		return instance;
	}
	
	public boolean checkNetwork(Context context)
	{
		ConnectivityManager connectivityManager = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE);
		NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();
		if(networkInfo != null)
		{
			return true;
		}
		else
		{
			return false;
		}		
	}
	
	
	
	

}
